package com.yupi.springbootinit.statemachine.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.Map;

/**
 * 状态转换请求DTO
 */
@Data
@Schema(description = "状态转换请求")
public class StateTransitionRequest {
    
    @NotNull(message = "实体ID不能为空")
    @Schema(description = "实体ID", example = "1001")
    private Long entityId;
    
    @NotBlank(message = "实体类型不能为空")
    @Schema(description = "实体类型", example = "ORDER", allowableValues = {"ORDER", "PROCESS_INSTANCE", "PROCESS_SHEET", "PRODUCTION_SCHEDULE", "QUALITY_INSPECTION"})
    private String entityType;
    
    @NotBlank(message = "源状态不能为空")
    @Schema(description = "源状态", example = "CREATED")
    private String fromState;
    
    @NotBlank(message = "目标状态不能为空")
    @Schema(description = "目标状态", example = "ROUTING_PUBLISHED")
    private String toState;
    
    @Schema(description = "事件代码", example = "PUBLISH_ROUTING")
    private String eventCode;
    
    @NotNull(message = "操作人ID不能为空")
    @Schema(description = "操作人ID", example = "1001")
    private Long operatorId;
    
    @NotBlank(message = "操作人姓名不能为空")
    @Schema(description = "操作人姓名", example = "张三")
    private String operatorName;
    
    @Schema(description = "备注", example = "工艺单发布完成")
    private String remark;
    
    @Schema(description = "扩展参数")
    private Map<String, Object> parameters;
}